const path = require('path')
module.exports = {
  chainWebpack: config => {
    config.resolve
      .alias
        .set('@', path.resolve(__dirname, 'src'))
        .set('@api', path.resolve(__dirname, 'src/api'))
        .set('@views', path.resolve(__dirname, 'src/views'))
        .set('@utils', path.resolve(__dirname, 'src/utils'))
        .set('@store', path.resolve(__dirname, 'src/store'))
        .set('@plugin', path.resolve(__dirname, 'src/plugin'))
        .set('@router', path.resolve(__dirname, 'src/router'))
        .set('@assets', path.resolve(__dirname, 'src/assets'))
        .set('@component', path.resolve(__dirname, 'src/component'))
  },
  devServer: {
    proxy: {
      '/api': {
        target: 'https://121.46.128.40',
        ws: true,
        changeOrigin: true
      }
    }
  }
}